package com.asp.aspchain.mmwyaccount.controller;

import com.asp.aspchain.mmwyaccount.constants.ErrorCode;
import com.asp.aspchain.mmwyaccount.service.MmwyQuebalService;
import com.asp.aspchain.core.util.AjaxResult;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/account")
public class MmwyQryController {
	
	private final static Logger logger = Logger.getLogger(MmwyQryController.class);
	@Autowired
    private MmwyQuebalService eoaQuebalService;
	
	@PostMapping("/coa/MMWY/qryblance")
	public AjaxResult mmwyQryblance(@RequestBody String json) {
		
		logger.info("=============mmwy查询账户接口开始=============");
    	//接受前端请求记录内部日志
    	AjaxResult ajaxResult = new AjaxResult();
    	try{
    		ajaxResult = eoaQuebalService.mmwyQueryBalance(json);
    	}catch (Exception e) {
    		logger.error("mmwyQryblance接口错误："+e.getMessage());
    		ajaxResult.setTips("系统内部错误");
    		ajaxResult.setMessage("系统内部错误");
    		ajaxResult.setStatus(ErrorCode.INTERNAL_ERROR);
		}
    	logger.info("=============mmwy查询账户接口结束=============");
    	return ajaxResult;
	}
	
}
